package com.qk.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.qk.common.PageResult;
import com.qk.entity.OperateLog;
import com.qk.mapper.OperateLogMapper;
import com.qk.service.OperateLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class OperateLogServiceImpl extends ServiceImpl<OperateLogMapper, OperateLog> implements OperateLogService {
    @Autowired
    private OperateLogMapper OperatelogMapper;
    @Override
    public PageResult<OperateLog> listLogs(OperateLog operateLog) {
        Page<OperateLog> operateLogs = OperatelogMapper.listLogs(new Page<OperateLog>(operateLog.getPage(), operateLog.getPageSize()), operateLog);
        return new PageResult<>(operateLogs.getTotal(), operateLogs.getRecords());
    }
}
